﻿using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using static AutoDarkModeSvc.Handlers.IThemeManager.TmHandler;

namespace AutoDarkModeSvc.Handlers.IThemeManager;

/*
* Source: https://github.com/kuchienkz/KAWAII-Theme-Swithcer/blob/master/KAWAII%20Theme%20Switcher/KAWAII%20Theme%20Helper.cs
* Originally created by Kuchienkz.
* Email: wahyu.darkflame@gmail.com
* Licensed under: GNU General Public License v3.0
* 
* Other Contributors (modified by):
* Armin2208
* Spiritreader
*/

internal class Interfaces
{
    [ComImport, Guid("D23CC733-5522-406D-8DFB-B3CF5EF52A71"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface ITheme
    {
        [DispId(0x60010000)]
        string DisplayName
        {
            [return: MarshalAs(UnmanagedType.BStr)]
            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            get;
        }
        [DispId(0x60010001)]
        string VisualStyle
        {
            [return: MarshalAs(UnmanagedType.BStr)]
            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            get;
        }
    }
    [ComImport, Guid("0646EBBE-C1B7-4045-8FD0-FFD65D3FC792"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IThemeManager
    {
        [DispId(0x60010000)]
        ITheme CurrentTheme
        {
            [return: MarshalAs(UnmanagedType.Interface)]
            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            get;
        }
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
        void ApplyTheme([In, MarshalAs(UnmanagedType.BStr)] string bstrThemePath);
    }
    [ComImport, Guid("A2C56C2A-E63A-433E-9953-92E94F0122EA"), CoClass(typeof(ThemeManagerClass))]
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
    public interface ThemeManager : IThemeManager { }
}
